package utility;

public class SymbolEntry {
    private String name;
    private Attributes attributes;
    private SymbolEntry var;
    private SymbolEntry level;
    private SymbolEntry hash;
    private SymbolEntry prehash;
    private int depth;

    SymbolEntry() {

    }

    SymbolEntry(Attributes attributes) {
        this.attributes = attributes;
    }

    public Boolean equals(SymbolEntry sym) {

        if ((var == null && sym.var != null) || var != null
                && sym.getVar() == null || (level == null && sym.level != null)
                || (level != null && sym.level == null)
                || (hash == null && sym.hash != null)
                || (hash != null && sym.hash == null)
                || (prehash == null && sym.prehash != null)
                || (prehash != null && sym.prehash == null) )
            return false;

        if (name.equals(sym.name)
                && attributes.equals(sym.getAttributes())
                && ((var == null && sym.var == null) || var.equals(sym.var))
                && ((level == null && sym.level == null) || level
                        .equals(sym.level))
                && ((hash == null && sym.hash == null) || hash.equals(sym.hash))
                && ((prehash == null && sym.prehash == null) || prehash
                        .equals(sym.prehash)) && depth == sym.getDepth())
            return true;
        return false;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Attributes getAttributes() {
        return attributes;
    }

    public void setAttributes(Attributes attributes) {
        this.attributes = attributes;
    }

    public SymbolEntry getVar() {
        return var;
    }

    public void setVar(SymbolEntry var) {
        this.var = var;
    }

    public SymbolEntry getLevel() {
        return level;
    }

    public void setLevel(SymbolEntry level) {
        this.level = level;
    }

    public SymbolEntry getHash() {
        return hash;
    }

    public void setHash(SymbolEntry hash) {
        this.hash = hash;
    }

    public int getDepth() {
        return depth;
    }

    public void setDepth(int depth) {
        this.depth = depth;
    }

    public SymbolEntry getPrehash() {
        return prehash;
    }

    public void setPrehash(SymbolEntry prehash) {
        this.prehash = prehash;
    }

}
